<?php
/**
 * Created by PhpStorm.
 * User: gm
 * Date: 2018/12/12
 * Time: 9:41
 */
include "config.php";
include "status.php";
if($_SERVER["REQUEST_METHOD"]=="POST"){
    $UID=$_REQUEST["u_id"];
    $sql="SELECT * FROM cart WHERE u_id=?;";
    $stmt=$conn->prepare($sql);
    $stmt->bind_param("i",$UID);
    $stmt->execute();
    $result=$stmt->get_result();
    if($result->num_rows>=1){
        $resArr=array();
        while($row=$result->fetch_assoc()){
            array_push($resArr,$row);
        }
        print_r(json_encode($resArr));
    }
}else{
    print_r(json_encode(Status::$no_get));
}